﻿<div id="tableRecordDetails" class="reveal-modal medium" data-bind="modalSuccess: addOnSuccess, enterPressed: submit">
    <h2>Table Record</h2>
    <table class="entity-properties" data-bind="with: record">
        <thead>
            <tr>
                <th class="property">Property</th>
                <th class="type">Type</th>
                <th class="value">Value</th>
            </tr>
        </thead>
        <tbody data-bind="foreach: fields">
            <tr>
                <td>
                    <!-- ko if:canChangeName -->
                    <input type="text" data-bind="value: name, title: name" />
                    <!-- /ko -->
                    <!-- ko ifnot:canChangeName -->
                    <span data-bind="text: name, title: name"></span>
                    <!-- /ko -->
                </td>
                <td>
                    <!-- ko if:canChangeType -->
                    @Html.Partial("Tables/EdmType")
                    <!-- /ko -->
                    <!-- ko ifnot:canChangeType -->
                    <span data-bind="text: new EdmTypes().toReadable(edmType()), title: new EdmTypes().toReadable(edmType())"></span>
                    <!-- /ko -->
                </td>
                <td>
                    <!-- ko if:canChangeValue -->
                    <input type="text" data-bind="value: value, title: value" />
                    <!-- /ko -->
                    <!-- ko ifnot:canChangeValue -->
                    <span data-bind="text: value() ? value() : 'Will be set by server', title: value() ? value() : 'Will be set by server'"></span>
                    <!-- /ko -->
                </td>
            </tr>
        </tbody>
    </table>
    <input type="button" class="button" value="Create" data-bind="click: submit, value: isNew() ? 'Create' : 'Update'" />
    <a class="close-reveal-modal">&#215;</a>
</div>
